"use strict";
cc._RF.push(module, '4ca46Z9iF9IubvV5oaAy1IW', 'ChampionManager');
// scripts/ChampionManager.js

"use strict";

var t = require;
var e = module;
var o = exports;
Object.defineProperty(o, "__esModule", {
  value: !0
}), o.GradeLevel = void 0;
var i,
    n = t("CarConstant"),
    a = t("GlobalUserData"),
    r = t("Util"),
    s = t("Global"),
    l = t("AssetsManager");

(function (t) {
  t[t.bronzeGrade = 0] = "bronzeGrade", t[t.silverGrade = 1] = "silverGrade", t[t.goldGrade = 2] = "goldGrade", t[t.platinumGrade = 3] = "platinumGrade", t[t.diamondGrade = 4] = "diamondGrade", t[t.kingGrade = 5] = "kingGrade", t[t.superGrade = 6] = "superGrade";
})(i = o.GradeLevel || (o.GradeLevel = {}));

var c = function () {
  function t() {
    this.isasda = 0;
  }

  return Object.defineProperty(t, "Ins", {
    get: function get() {
      return null == t.instance && (t.instance = new t()), t.instance;
    },
    enumerable: !1,
    configurable: !0
  }), t.prototype.setGradeWithFrame = function (t, e) {
    var o;

    switch (void 0 === e && (e = -1), -1 == e ? this.getGradeLevel(a["default"].nTrophy) : this.getGradeLevel(e)) {
      case i.bronzeGrade:
        o = l.assets.bronzeGrade;
        break;

      case i.silverGrade:
        o = l.assets.silverGrade;
        break;

      case i.goldGrade:
        o = l.assets.goldGrade;
        break;

      case i.platinumGrade:
        o = l.assets.platinumGrade;
        break;

      case i.diamondGrade:
        o = l.assets.diamondGrade;
        break;

      case i.kingGrade:
        o = l.assets.kingGrade;
        break;

      case i.superGrade:
        o = l.assets.superGrade;
        break;

      default:
        o = l.assets.bronzeGrade;
    }

    r.Util.getAssets(r.Util.getBundle(l.BundleName.XIE), o).then(function (e) {
      t.spriteFrame = new cc.SpriteFrame(e);
    });
  }, t.prototype.getGradeLevel = function (t) {
    return t >= 0 && t <= 99 ? i.bronzeGrade : t >= 100 && t <= 299 ? i.silverGrade : t >= 300 && t <= 699 ? i.goldGrade : t >= 700 && t <= 1299 ? i.platinumGrade : t >= 1300 && t <= 1899 ? i.diamondGrade : t >= 1900 && t <= 2499 ? i.kingGrade : t >= 2500 ? i.superGrade : i.bronzeGrade;
  }, t.prototype.getTrophyExtentWithGrade = function (t) {
    switch (t) {
      case i.bronzeGrade:
        return [0, 99];

      case i.silverGrade:
        return [100, 299];

      case i.goldGrade:
        return [300, 699];

      case i.platinumGrade:
        return [700, 1299];

      case i.diamondGrade:
        return [1300, 1899];

      case i.kingGrade:
        return [1900, 2499];

      case i.superGrade:
        return [2500, 2500];

      default:
        return [0, 99];
    }
  }, t.prototype.getTrophyMulti = function (e) {
    if (e) {
      if (t.Ins.getGradeLevel(a["default"].nTrophy) > t.Ins.getGradeLevel(a["default"].enemyTrophy)) return .5;
      if (t.Ins.getGradeLevel(a["default"].nTrophy) == t.Ins.getGradeLevel(a["default"].enemyTrophy)) return 1;
      if (t.Ins.getGradeLevel(a["default"].nTrophy) + 1 == t.Ins.getGradeLevel(a["default"].enemyTrophy)) return 1.3;
      if (t.Ins.getGradeLevel(a["default"].nTrophy) + 2 == t.Ins.getGradeLevel(a["default"].enemyTrophy)) return 1.6;
    } else {
      if (t.Ins.getGradeLevel(a["default"].nTrophy) > t.Ins.getGradeLevel(a["default"].enemyTrophy)) return 1.5;
      if (t.Ins.getGradeLevel(a["default"].nTrophy) == t.Ins.getGradeLevel(a["default"].enemyTrophy)) return 1;
      if (t.Ins.getGradeLevel(a["default"].nTrophy) + 1 == t.Ins.getGradeLevel(a["default"].enemyTrophy)) return .75;
      if (t.Ins.getGradeLevel(a["default"].nTrophy) + 2 == t.Ins.getGradeLevel(a["default"].enemyTrophy)) return .5;
    }

    return 1;
  }, Object.defineProperty(t.prototype, "gradeRewardList", {
    get: function get() {
      return [{
        index: 0,
        trophy: 100,
        id: "",
        name: "金币",
        type: n.Basics_Items_Type.gold,
        num: 3e3,
        star: 1,
        isGot: !1,
        quality: s.Quality.common
      }, {
        index: 1,
        trophy: 300,
        id: n.Weapon_ID.Laser,
        name: "三星激光炮",
        type: n.Basics_Items_Type.weapon,
        num: 1,
        star: 3,
        isGot: !1,
        quality: s.Quality.Legendary
      }, {
        index: 2,
        trophy: 500,
        id: "",
        name: "钻石",
        type: n.Basics_Items_Type.diamond,
        num: 300,
        star: 1,
        isGot: !1,
        quality: s.Quality.common
      }, {
        index: 3,
        trophy: 700,
        id: n.Tools_ID.Landmine,
        name: "四星地雷装置",
        type: n.Basics_Items_Type.tools,
        num: 1,
        star: 4,
        isGot: !1,
        quality: s.Quality.Legendary
      }, {
        index: 4,
        trophy: 900,
        id: "",
        name: "钻石",
        type: n.Basics_Items_Type.diamond,
        num: 600,
        star: 1,
        isGot: !1,
        quality: s.Quality.common
      }, {
        index: 5,
        trophy: 1100,
        id: n.Weapon_ID.Gatlin,
        name: "四星武器加特林",
        type: n.Basics_Items_Type.weapon,
        num: 1,
        star: 4,
        isGot: !1,
        quality: s.Quality.Legendary
      }, {
        index: 6,
        trophy: 1300,
        id: "",
        name: "金币",
        type: n.Basics_Items_Type.gold,
        num: 1e4,
        star: 1,
        isGot: !1,
        quality: s.Quality.common
      }, {
        index: 7,
        trophy: 1500,
        id: "body05",
        name: "五星车身磐石",
        type: n.Basics_Items_Type.body,
        num: 1,
        star: 5,
        isGot: !1,
        quality: s.Quality.epic
      }, {
        index: 8,
        trophy: 1700,
        id: "",
        name: "钻石",
        type: n.Basics_Items_Type.diamond,
        num: 1e3,
        star: 1,
        isGot: !1,
        quality: s.Quality.common
      }, {
        index: 9,
        trophy: 1900,
        id: n.Tools_ID.Landmine,
        name: "五星地雷装置",
        type: n.Basics_Items_Type.tools,
        num: 1,
        star: 5,
        isGot: !1,
        quality: s.Quality.Legendary
      }, {
        index: 10,
        trophy: 2100,
        id: "",
        name: "金币",
        type: n.Basics_Items_Type.gold,
        num: 3e4,
        star: 1,
        isGot: !1,
        quality: s.Quality.common
      }, {
        index: 11,
        trophy: 2300,
        id: "",
        name: "钻石",
        type: n.Basics_Items_Type.diamond,
        num: 2e3,
        star: 1,
        isGot: !1,
        quality: s.Quality.common
      }, {
        index: 12,
        trophy: 2500,
        id: n.Weapon_ID.Laser,
        name: "五星激光炮",
        type: n.Basics_Items_Type.weapon,
        num: 1,
        star: 5,
        isGot: !1,
        quality: s.Quality.Legendary
      }];
    },
    enumerable: !1,
    configurable: !0
  }), t.prototype.getGradeName = function (t) {
    switch (t) {
      case i.bronzeGrade:
        return "青铜";

      case i.silverGrade:
        return "白银";

      case i.goldGrade:
        return "黄金";

      case i.platinumGrade:
        return "白金";

      case i.diamondGrade:
        return "钻石";

      case i.kingGrade:
        return "王者";

      case i.superGrade:
        return "荣耀王者";

      default:
        return "青铜";
    }
  }, t.prototype.getETrophy = function () {
    switch (a["default"].nTotalGame) {
      case 0:
        return 30;

      case 1:
        return 124;

      case 2:
        return 152;

      default:
        var e = t.Ins.getTrophyExtentWithGrade(t.Ins.getGradeLevel(a["default"].nTrophy)),
            o = e[1] - e[0];
        return a["default"].nTrophy <= 2500 ? r.Util.getRandomInt(Math.max(0, a["default"].nTrophy - o / 3), e[1] + o / 3) : r.Util.getRandomInt(a["default"].nTrophy - 500, a["default"].nTrophy + 500);
    }
  }, t.prototype.getGradeBuff = function (t, e) {
    switch (null == t ? e : this.getGradeLevel(t)) {
      case i.bronzeGrade:
        return {
          goldBuff: 0,
          vitBuff: 0,
          upgrade: 0,
          lottery: 0,
          box: "普通"
        };

      case i.silverGrade:
        return {
          goldBuff: .25,
          vitBuff: 0,
          upgrade: 0,
          lottery: 0,
          box: "普通"
        };

      case i.goldGrade:
        return {
          goldBuff: .5,
          vitBuff: 5,
          upgrade: 0,
          lottery: 0,
          box: "普通"
        };

      case i.platinumGrade:
        return {
          goldBuff: .75,
          vitBuff: 10,
          upgrade: .1,
          lottery: 1,
          box: "史诗"
        };

      case i.diamondGrade:
        return {
          goldBuff: 1,
          vitBuff: 15,
          upgrade: .15,
          lottery: 1,
          box: "史诗"
        };

      case i.kingGrade:
        return {
          goldBuff: 1.5,
          vitBuff: 20,
          upgrade: .2,
          lottery: 2,
          box: "传说"
        };

      case i.superGrade:
        return {
          goldBuff: 2,
          vitBuff: 25,
          upgrade: .25,
          lottery: 3,
          box: "传说"
        };

      default:
        return {
          goldBuff: 0,
          vitBuff: 0,
          upgrade: 0,
          lottery: 0,
          box: "普通"
        };
    }
  }, t.instance = null, t;
}();

o["default"] = c;

cc._RF.pop();